package com.huawei.hms.a.a.a;

import android.text.TextUtils;
import com.huawei.hms.support.log.HMSLog;
import org.json.JSONException;
import org.json.JSONObject;

public class e {
    private Integer a;
    private String b;

    public Integer a() {
        return this.a;
    }

    public void a(Integer num) {
        this.a = num;
    }

    public String b() {
        return this.b;
    }

    public void a(String str) {
        this.b = str;
    }

    public static e b(String str) {
        if (TextUtils.isEmpty(str)) {
            return new e();
        }
        try {
            Integer valueOf;
            String string;
            JSONObject jSONObject = new JSONObject(str);
            if (jSONObject.has("errorCode")) {
                valueOf = Integer.valueOf(jSONObject.getInt("errorCode"));
            } else {
                valueOf = null;
            }
            if (jSONObject.has("errorMsg")) {
                string = jSONObject.getString("errorMsg");
            } else {
                string = null;
            }
            e eVar = new e();
            eVar.a(valueOf);
            eVar.a(string);
            return eVar;
        } catch (JSONException e) {
            HMSLog.e("SmsRetrieverOutputBean", "SmsRetrieverOutputBean json parse falied");
            return new e();
        }
    }
}
